#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#define ARGS_CHECK(argc, num)               \
    {                                       \
        if (argc != num)                    \
        {                                   \
            fprintf(stderr, args error !n); \
            return -1;                      \
        }                                   \
    }
#define ERROR_CHECK(ret, num, msg) \
    {                              \
        if (ret == num)            \
        {                          \
            perror(msg);           \
            exit(1);               \
        }                          \
    }
int main(int argc, char *argv[])
{

    int fd = open("namepipe.pipe", O_RDONLY);
    char r_buf[32] = {0};
    while (1)
    {
        read(fd,r_buf,sizeof(r_buf));
        puts(r_buf);
        memset(r_buf,0,sizeof(r_buf));
    }

    return 0;
}
